<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="./vue.js" type="text/javascript" charset="utf-8"></script>

</head>
<style>
    .inner {
        height: 150px;
        background-color: darkcyan;
    }

</style>
<body>
<div id="app">
    <div class="inner" @click="divHandler">
        <input type="button" value="戳他" @click.stop="btnHandler">
    </div>
    <a href="https://www.baidu.com" @click.prevent="go">这是一个连接</a>
    <!--<div class="inner" @click.capture="divHandler">-->
    <!--<input type="button" value="戳他（捕获）" @click="btnHandler">-->
    <!--</div>-->
    <!--self-->
    <div class="inner" @click.self="divHandler">
        <input type="button" value="戳他" @click="btnHandler">
    </div>
</div>
<script>
    // 创建一个vue实例
    new Vue({
        el:'#app',
        data:{
            msg:'信息'
        },
        methods:{
            divHandler() {
                console.log('外部')
            },
            btnHandler() {
                console.log('内部')
            },
            go() {
                console.log('结果')
            }
        }
    })
</script>
</body>
</html>
